﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true" CodeBehind="EnterpriseCorpAllInfo.aspx.cs" Inherits="RN.ERP.Web.Enterprise.EnterpriseCorpAllInfo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
  <link href="../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery.min.js" type="text/javascript"></script> 
     <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript">
        $(function () {
            SetEmpTypeData();
            // var height = $(".l-layout-center").height();
            //Tab
            $("#tab1").ligerTab({
                onAfterSelectTabItem: function (tabid) {
                    SetTabUrl(tabid);
                }
            });
        });
        //加载url
        function SetTabUrl(tabid) {
            var tab = liger.get("tab1");
            if (tabid.indexOf("psn") >= 0) {
                var num = $.trim(tabid.replace("psn", ""));
                if ($("#IframePsn" + num).attr("src") == "") {
                    var itemType = $("#IframePsn" + num).attr("itemtype");
                    $("#IframePsn" + num).attr("src", "../person/PersonEmpList.aspx?corpUserGuid=<%=corpUserGuid %>&itemType=" + itemType)
                }
                    //tab.overrideTabItem("psn", { text: "人员信息", url: "../person/PersonEmpList.aspx?corpUserGuid=<%=corpUserGuid %>" });
            }
            if (tabid == "score" && $("#IframesScore").attr("src") == "") {
                $("#IframesScore").attr("src", "http://123.234.82.27/bzkweb/Project/ProjectYJByCorp.aspx?CorpUserGuid=<%=corpUserGuid %>")                  
            }
      }
      //所有人员类型数据源
      function EmpTypeData() {
          var data = {
              "2501": [{ "id": "1", "title": "施工五大员", "itemtype": "1013,1014,1015,1016,1017" }, { "id": "2", "title": "项目经理", "itemtype": "0,1" }, { "id": "3", "title": "其他人员", "itemtype": "1;0,1,1013,1014,1015,1016,1017"}],
              "2502": [{ "id": "1", "title": "项目总监", "itemtype": "2" }, { "id": "2", "title": "其他人员", "itemtype": "1;2" }],
              "7330": [{ "id": "1", "title": "项目经理", "itemtype": "0,1" }, { "id": "2", "title": "其他人员", "itemtype": "1;0,1" }],
              "8010": [{ "id": "1", "title": "代理人员", "itemtype": "8000" }, { "id": "2", "title": "其他人员", "itemtype": "1;8000" }],
              "0": [{ "id": "1", "title": "人员信息", "itemtype": "" }]
          };
          return data;
      }
      //取得当前人员类型列表
      function SetEmpTypeData() {
          var isShowEmp = "<%=IsCheckShowEmp %>";
          if (isShowEmp == "0") {
              BindEmpItemList(null);
              return;
          }
          var classTagId = "<%=classId %>";
          var str=",2501,2502,7330,8010,";
          if (str.indexOf(","+classTagId+",")<0)
          {
              classTagId = "0";
          }
          var dt=EmpTypeData();
          var data=dt[classTagId];
          if (data == null || data == "undefined") {
            return;
          }
        BindEmpItemList(data);
      }
     //根据人员类型生成页面显示区
      function BindEmpItemList(data) {
          var list = "";
          if (data != null && data != "undefined") {
              for (var i = 0, j = data.length; i < j; i++) {
                  var item = data[i];
                  list += " <div  tabid=\"psn" + item.id + "\" title=\"" + item.title + "\">";
                  list += "<iframe frameborder=\"0\" style=\"width: 1160px;  height:780px;\" name=\"home\" id=\"IframePsn" + item.id + "\" src=\"\" itemtype=\"" + item.itemtype + "\"></iframe> </div>";
              }
          }
         list += "<div  tabid=\"score\" title=\"业绩信息\"><iframe frameborder=\"0\" name=\"home\"  style=\"width: 1160px;  height:780px;\" id=\"IframesScore\" src=\"\" itemtype=\"\"></iframe></div>";
         $("#tab1").append(list);
     }

    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="tab1" style="width: 1160px; height:810px; overflow:hidden;">
        <div tabid="corp" title="企业信息">
            <iframe frameborder="0" style="width: 1160px;height:780px" name="home" id="Iframecorp" src="../Enterprise/EnterpriseCorpInfo.aspx?corpUserGuid=<%=corpUserGuid %>" itemtype=""></iframe>
        </div>
    
    </div>
</asp:Content>
